package com.sziit.se.highconcurrency.order.application.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sziit.se.highconcurrency.order.application.entity.OrderDetail;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author dongchunkeng
 * @since 2022-11-09
 */
public interface OrderDetailMapper extends BaseMapper<OrderDetail> {
    List<OrderDetail> getAllData();

    Boolean insertOrderDetail(
            @Param("orderId") String orderId,
            @Param("productId") String productId,
            @Param("amount") int amount
    );

    List<OrderDetail> getProductByOrderId(@Param("orderId") String orderId);

    OrderDetail getProductByOrderIdAndProductId(@Param("orderId") String orderId,
                                                      @Param("productId") String productId);
}
